#include <vector>
#include<iostream>
using namespace std;
vector<int> countBits(int n)
{
    vector<int> v1(n + 1);
    for (int i = 0; i <= n; i++)
    {
        int sum = 0;
        int x = i;
        while (x)
        {
            sum++;
            x = x& (x - 1);
        }
        v1[i] = sum;
    }
    return v1;
}
int main()
{
    countBits(2);
    return 0;
}